package javaStudy.io流;

import java.io.*;
//4. 字节缓冲流
public class BufferStreamDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos =new FileOutputStream("fos.txt");
        BufferedOutputStream bos=new BufferedOutputStream(fos);
        bos.write("abc".getBytes());
        bos.write(97);
        bos.close();
        FileInputStream fis=new FileInputStream("fos.txt");
        BufferedInputStream bis=new BufferedInputStream(fis);
        int by;
        while((by= bis.read())!=-1){
            System.out.println((char) by);
        }
        bis.close();
  }
}
